<?php

namespace App\Http\Controllers;

use Illuminate\Http\Request;

class TestController extends Controller
{
    public function test(Request $request)
    {
        dd($this->PostCurl(['alias' => 87, 'content' => 'content']));
    }


    public function PostCurl($params = array())
    {
        $url = 'https://wechatlt.jkbanlv.com/push/SendToOne';
        $params['pcs'] = 3;
        $params = http_build_query($params);
        $con = curl_init((string)$url);
        curl_setopt($con, CURLOPT_HEADER, false);
        curl_setopt($con, CURLOPT_POSTFIELDS, $params);
        curl_setopt($con, CURLOPT_POST, true);
        curl_setopt($con, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($con, CURLOPT_TIMEOUT, (int)30);
        $output = curl_exec($con);
        curl_close($con);
        return json_decode($output, true);
    }

}
